<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="ColaboradorCreateDlg" widgetVar="ColaboradorCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{seriesBundle.CreateColaboradorTitle}" closeOnEscape="true">

            <h:form id="ColaboradorCreateForm">

                <h:panelGroup id="display" rendered="#{colaboradorController.selected != null}">
                    <p:panelGrid columns="2" columnClasses="column">

                        <p:outputLabel value="#{seriesBundle.CreateColaboradorLabel_descripcion}" for="descripcion" />
                        <h:panelGroup>
                            <p:inputText id="descripcion" value="#{colaboradorController.selected.descripcion}" title="#{seriesBundle.CreateColaboradorTitle_descripcion}" required="true" requiredMessage="#{seriesBundle.CreateColaboradorRequiredMessage_descripcion}" size="20" maxlength="20"/>
                            <p:tooltip for="descripcion" value="#{colaboradorController.getComponentMessages('descripcion', seriesBundle.CreateColaboradorHelpText_descripcion)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.CreateColaboradorLabel_sexo}" for="sexo" />
                        <h:panelGroup>
                            <p:inputText id="sexo" value="#{colaboradorController.selected.sexo}" title="#{seriesBundle.CreateColaboradorTitle_sexo}"/>
                            <p:tooltip for="sexo" value="#{colaboradorController.getComponentMessages('sexo', seriesBundle.CreateColaboradorHelpText_sexo)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.CreateColaboradorLabel_contacto}" for="contacto" />
                        <h:panelGroup>
                            <p:inputText id="contacto" value="#{colaboradorController.selected.contacto}" title="#{seriesBundle.CreateColaboradorTitle_contacto}" size="100" maxlength="100"/>
                            <p:tooltip for="contacto" value="#{colaboradorController.getComponentMessages('contacto', seriesBundle.CreateColaboradorHelpText_contacto)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.CreateColaboradorLabel_idRango}" for="idRango" />
                        <h:panelGroup>
                            <p:selectOneMenu id="idRango" value="#{colaboradorController.selected.idRango}" required="true" requiredMessage="#{seriesBundle.CreateColaboradorRequiredMessage_idRango}" converter="xRangoConverter">
                                <f:selectItem itemLabel="#{seriesBundle.SelectOneMessage}"/>
                                <f:selectItems value="#{xRangoController.items}"
                                               var="idRangoItem"
                                               itemValue="#{idRangoItem}"
                                               itemLabel="#{idRangoItem.descripcion.toString()}"
                                               />

                            </p:selectOneMenu>
                            <p:tooltip for="idRango" value="#{colaboradorController.getComponentMessages('idRango', seriesBundle.CreateColaboradorHelpText_idRango)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.CreateColaboradorLabel_idImagen}" for="idImagen" />
                        <h:panelGroup>
                            <p:selectOneMenu id="idImagen" value="#{colaboradorController.selected.idImagen}"  converter="xImagenConverter">
                                <f:selectItem itemLabel="#{seriesBundle.SelectOneMessage}"/>
                                <f:selectItems value="#{xImagenController.items}"
                                               var="idImagenItem"
                                               itemValue="#{idImagenItem}"
                                               itemLabel="#{idImagenItem.descripcion.toString()}"
                                               />

                            </p:selectOneMenu>
                            <p:tooltip for="idImagen" value="#{colaboradorController.getComponentMessages('idImagen', seriesBundle.CreateColaboradorHelpText_idImagen)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.CreateColaboradorLabel_idPais}" for="idPais" />
                        <h:panelGroup>
                            <p:selectOneMenu id="idPais" value="#{colaboradorController.selected.idPais}"  converter="paisConverter">
                                <f:selectItem itemLabel="#{seriesBundle.SelectOneMessage}"/>
                                <f:selectItems value="#{paisController.items}"
                                               var="idPaisItem"
                                               itemValue="#{idPaisItem}"
                                               itemLabel="#{idPaisItem.descripcion.toString()}"
                                               />

                            </p:selectOneMenu>
                            <p:tooltip for="idPais" value="#{colaboradorController.getComponentMessages('idPais', seriesBundle.CreateColaboradorHelpText_idPais)}"/>
                        </h:panelGroup>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{colaboradorController.saveNew}" value="#{seriesBundle.Save}" update="display,:ColaboradorListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,PF('ColaboradorCreateDialog'));">
                        <p:confirm header="#{seriesBundle.ConfirmationHeader}" message="#{seriesBundle.ConfirmCreateMessage}" icon="ui-icon-alert"/>
                    </p:commandButton>

                    <p:commandButton value="#{seriesBundle.Cancel}" onclick="PF('ColaboradorCreateDialog').hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
